#include "No7pch.h"
#include "OpenGLRendererAPI.h"

#include <glad/glad.h>

void nmspc::OpenGLRendererAPI::setClearColor(const glm::vec4& color)
{
	glClearColor(color.r, color.g, color.b, color.a);
}

void nmspc::OpenGLRendererAPI::clear()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}

void nmspc::OpenGLRendererAPI::drawIndexed(const std::shared_ptr<nmspc::VertexArray>& vertex_array)
{
	glDrawElements(GL_TRIANGLES, vertex_array->getIndexBuffer()->getCount(), GL_UNSIGNED_INT, nullptr);
}
